package com.algorithm;

import java.util.UUID;

/**
 * @author: sun.hongliang
 * @create: 2019/12/03 18:08
 */
public class UniquePathsTest {

    public static void main(String[] args) {
        UUID.randomUUID();
    }

    public int uniquePaths(int m, int n) {
        int[][] dps = new int[m][n];
        for (int j = 0; j < n; j++) {
            dps[0][j] = 1;
        }
        for (int i = 0; i < m; i++) {
            dps[i][0] = i;
        }
        for (int i = 1; i < m; i++) {
            for (int j = 1; j < n; j++) {
                dps[i][j] = dps[i - 1][j] + dps[i][j - 1];
            }
        }
        return dps[m - 1][n - 1];
    }
}
